package cn.fintecher.pangolin.entity.elastic;

import cn.fintecher.pangolin.common.enums.BaseSelect;
import cn.fintecher.pangolin.common.enums.DeviceType;
import cn.fintecher.pangolin.common.utils.Constants;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;

import java.util.Date;

/**
 * @Auther: xiaqun
 * @Description: 系统登录日志
 * @Date: 15:53 2019/8/19
 */

@Data
@Document(indexName = Constants.SYSTEM_LOGIN_LOG, type = Constants.SYSTEM_LOGIN_LOG, shards = 1, replicas = 0)
public class SystemLoginLog {
    @ApiModelProperty(value = "主键ID")
    @Id
    private String id;

    @ApiModelProperty(value = "登录时间")
    private Date loginTime;

    @ApiModelProperty(value = "用户名")
    private String username;

    @ApiModelProperty(value = "用户姓名")
    private String realName;

    @ApiModelProperty(value = "登录类型")
    private DeviceType type;

    @ApiModelProperty(value = "IP地址")
    private String ip;

    @ApiModelProperty(value = "登录是否成功")
    private BaseSelect isSuccess;

    @ApiModelProperty(value = "失败原因")
    private String reason;
}
